import { http } from '@/utils/request'

// 通用API
export const commonAPI = {
  // 文件上传
  uploadFile: (formData) => {
    return http.post('/common/upload', formData, {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    })
  },
  
  // 获取字典数据
  getDictionary: (type) => http.get(`/common/dictionary/${type}`),
  
  // 获取案件类型列表
  getCaseTypes: () => http.get('/common/case-types'),
  
  // 获取地区列表
  getRegions: () => http.get('/common/regions'),
  
  // 获取法律资源分类
  getResourceCategories: () => http.get('/common/resource-categories'),
  
  // 获取律师专业领域
  getLawyerSpecialties: () => http.get('/common/lawyer-specialties'),
  
  // 获取系统配置
  getSystemConfig: () => http.get('/common/system-config'),
  
  // 发送反馈
  sendFeedback: (data) => http.post('/common/feedback', data),
  
  // 获取帮助文档
  getHelpDocs: (params) => http.get('/common/help-docs', params),
  
  // 获取帮助文档详情
  getHelpDocDetail: (id) => http.get(`/common/help-docs/${id}`),
  
  // 搜索
  search: (params) => http.get('/common/search', params)
} 